<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Crunchy Interpreter</title>
<link href="tutor.css" title="Tutor Style" type="text/css" rel="stylesheet" />
<link href="tutor.css" type="text/css" rel="stylesheet" />
<link href="tutor_bw.css" title="Black and white"
type="text/css" rel="stylesheet" />
<link href="tutor_menu.css" title="Tutor Style" type="text/css" rel="stylesheet" />

</head>
<body>
<div id="topbar">
<img alt="" src="suprised.gif" class="titleimage"/>
<span class="title">Prompting Python</span>
</div>
<div id="navbar">
<span class="heading">Crunchy user tutorial</span>
<a href="index.html">Welcome</a>
<a href="interpreter.html">Interpreter</a>
<a href="editor.html">Editor</a>
<a href="doctest.html">DocTest</a>
<a href="canvas.html">Graphics: drawing</a>
<a href="plot.html">Graphics: plotting</a>
<a href="sound.html">Sound</a>
<a href="external.html">External applications</a>
</div>
<div id="main">
<h2>A typical introduction to Python</h2>
<p>To begin your introduction to Crunchy, I will ask you to start you favourite Python interpreter, and type the following:</p>
<pre title="interpreter">
&gt;&gt;&gt; print 6*7
</pre>
<p>I expect that Python will respond with <b>
The Answer to The Ultimate Question Of Life, the Universe and Everything,</b>  <small>at least according to the Hitchhiker's Guide to the Galaxy.</small> 
I am assuming you are reading this html file for the first time using you basic web browser.  If that is not the case, and you are actually using 
Crunchy, you will have noticed that, right on this page, a Python interpreter will actually appear just below the Python example given above. 
this Python interpreter was actually inspired by and adapted from some great work by Robert Brewer. You will be able to use this interpreter and type 
<code>print 6*7</code>, press the enter key and see Python's answer 
<b><i>without having to leave your browser.</i></b>  You may have also 
noticed that the Python code was displayed in colour, with Python keywords in 
blue, numbers in red, operators in black, etc., quite unlike the boring all
black stuff of the original html page.</p>
<p>Impressive, isn't it?  Try a few more examples in the interpreter below; however, before that, type in <code>a=3</code> in the interpreter above.</p>
<pre title="interpreter linenumber">
&gt;&gt;&gt; print a
&gt;&gt;&gt; range(11)
&gt;&gt;&gt; print input("What is your name?")
</pre>
<p>After seeing these amazing feats, I am convinced that you will want to purchase Crunchy!</p>
<blockquote><i> I'm not interested in your sales! I have to protect the general public!</i><br />
<small>From the Monty Python's Crunchy Frog sketch.</small></blockquote>
<p>Crunchy is not for sale: it is free software.  However, it is not designed for the "general public".  Using a Python interpreter on a computer can lead to unwanted results, depending on the code that is being executed. [<font color='red'><code>import os:</code> use with caution!</font>]</p>
</div>
</body>
</html>
